﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SLInterpreter.S1
{
    public partial class CanvasBind : ChildWindow
    {
        public CanvasBind()
        {
            InitializeComponent();
            var vmContext = new VmContext();
            var oneVm = new Vm1();
            oneVm.Shapes.Add(new ShapeText() { Left = 5, Top = 10, Text = "One" });

            oneVm.Shapes.Add(new ShapeText() { Left = 5, Top = 30, Text = "One1" });

            vmContext.Vms.Add(oneVm);
            var twoVm = new Vm1();
            twoVm.Shapes.Add(new ShapeText() { Left = 50, Top = 50, Text = "Two" });
            vmContext.Vms.Add(twoVm);

            this.DataContext = vmContext;
        }

        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
        }

        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
        }
    }
}

